package com.example.passwordmanager.Util;

import android.os.Build;

import androidx.annotation.RequiresApi;

import java.util.Base64;

public class Base64Util {


    @RequiresApi(api = Build.VERSION_CODES.O)
    public static byte[] base64Encrypt(final String content) {
        return Base64.getEncoder().encode(content.getBytes());
    }

    /**
     * base64解密
     *
     * @param encoderContent 已加密内容
     * @return byte[]
     */

    @RequiresApi(api = Build.VERSION_CODES.O)
    public static byte[] base64Decrypt(final byte[] encoderContent) {
        return Base64.getDecoder().decode(encoderContent);
    }
}
